package main.java.util;

import java.io.IOException;
import java.util.Properties;

/**
 * 获取Properties配置文件中的信息
 * @author gzq
 *
 */
public class PropertiesUtil {
	
	private static String ftlBasePath;
	private static String outPutBasePath;
	
	public static String getFtlBasePath() {
		if(ftlBasePath == null) {
			Properties prop = new Properties();
			try {
				prop.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("main/resource/freemarkerConfig.properties"));
				ftlBasePath = prop.getProperty("ftlBasePath");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return ftlBasePath;
	}
	public void setFtlBasePath(String ftlBasePath) {
		PropertiesUtil.ftlBasePath = ftlBasePath;
	}
	
	public static String getOutPutBasePath() {
		if(outPutBasePath == null) {
			Properties prop = new Properties();
			try {
				prop.load(PropertiesUtil.class.getClassLoader().getResourceAsStream("main/resource/freemarkerConfig.properties"));
				outPutBasePath = prop.getProperty("outPutBasePath");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return outPutBasePath;
	}
	public void setOutPutBasePath(String outPutBasePath) {
		PropertiesUtil.outPutBasePath = outPutBasePath;
	}
	
	

}
